{% extends "basic.html" %}

{% block content %}
	<div class="main fr">
      	<a href="/news/"><h2>最新消息</h2></a>
        <div class="text">
        	{% for new in news%}
	        <div class="news">
	        	<h3><a href="/news/{{ new.id }}/">{{ new.title }}</a></h3>
	        	<div class="date">作者：{{ new.author }} &nbsp;&nbsp;&nbsp;发表时间:&nbsp;{{ new.post_time|date:"Y-m-d H:i" }}</div>
	        	{% if new.image %}
	        	<img src="{{ new.image.url }}" class="newsimage" />
	       		{% endif %}
	          	<p>{{ new.content }}</p>
          	</div>
          	{% endfor %}
          	{% if user.is_admin %}
          	<a href="/admin/home/news/add/">发布新闻</a>
          	{% endif %}
          	<div class="more"><a href="/news/">more...</a></div>
        </div>
        <h2>本周新关注项目</h2>
        <div class="text">
        {% for att in attention %}
        	<div class="list">{{att.duty_person}} 关注 <a href="/project/{{ att.id }}/">{{ att.name }}</a></div>
        {% endfor %}
        {% if user %}
          <a href="/admin/home/project/add/">增加关注项目</a><br>
        {% endif %}
        <div class="more">
        <a href="/project/attention/">more...</a>
        </div>
        </div>
        <h2>本周提交项目</h2>
        <div class="text">
        {% for s in submit %}
        	<div class="list">{{ s.duty_person }} 需提交 <a href="/project/{{ s.id }}/">{{ s.name }}</a></div>
        {% endfor %}
          <div class="more"><a href="/project/submit/">more...</a></div>
        </div>
        <h2>正在进行的项目</h2>
        <div class="text">
        {% for p in doing %}
        	<div class="list">{{ p.duty_person }} 负责 <a href="/project/{{ p.id }}/">{{ p.name }}</a></div>
        {% endfor %}
        <div class="more"><a href="/project/all/">more...</a></div>
        </div>
        <div class="clearfix"></div>
    </div>
{% endblock %}